Using the alt Attribute in HTML Images
The alt attribute in an <img> tag provides alternative text for an image. It is displayed if the image cannot be loaded and is also read by screen readers, making web content accessible to visually impaired users. The alt text should describe the content or purpose of the image.
The alt attribute provides text shown when an image cannot be loaded.
It improves accessibility by giving screen readers a description of the image.
Alt text should be concise and meaningful, describing the image’s content or function.
For decorative images, an empty alt (alt="") is recommended so screen readers skip it.
It is an essential part of good SEO, as search engines also use alt text to understand images.